-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multiple locations on job listings #674
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/jobs/list-item.tsx
Outdated
{`${item.locations.map((location) => { | ||
return ' ' + location.city; | ||
})}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{`${item.locations.map((location) => { | |
return ' ' + location.city; | |
})}`} | |
{item.locations.map((location) => { | |
return ' ' + location.city; | |
}).toString()} |
Kunne man bare tatt bort disse? Evt med en toString()
dersom jsx ikke gjør det for oss
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Av en eller annen uforklarlig grunn (for meg) sørger ${}
for å automatisk legge på komma mellom elementene. Det finnes sikkert en god grunn til hvorfor, men jeg tenkte at det var bedre å beholde de automagiske kommaene, enn å lage noe som ordna komma selv 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Det blir om til en array som gjøres toString når det template literals inn og da blir det automatisk komma. Om du vil gjøre det "korrekt" så kan det være slik:
{item.locations.map((location) => {
return location.city;
}).join(', ')}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nå snakker vi, takk!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Har oppdatert forslaget mitt med en toString() som ser ut til å gjøre så man får med seg kommaene. Kommer om forskjeller på hvordan jsx og toString()-funksjonen konkatinerer arrays når den skal stringifisere de. ${``}
er i praksis det samme som toString()
, bare litt mindre eksplisitt.
Er ikke egentlig så viktig dette altså, men når jeg først kommenterte på det kan jeg like godt følge det opp 😅
Edit: Hadde jeg refresha sida hadde jeg sett at Mikael allerede hadde forklart og kommet med et bedre forslag. Ups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meeeen Mikael sitt forslag er mer eksplisitt, så støtter det i stedet 🥇
Co-authored-by: Jakob Endrestad Kielland <[email protected]>
Short Description
Add support for multiple locations on job listings.
Visual Overview (Image/Video)
This is how it looks now:
This is how it looked before:
Checklist
Please ensure that you’ve completed the following checkpoints before submitting your pull request:
Additional Notes
Other comments relevant to this pull request.